<template>
      <div class="marLR20">
        <!-- 日历 + 今日运势 + 通知 -->
        <el-row :gutter="20">
            <el-col :span="18">
                <div>
                    <el-row  :gutter="20">
                        <el-col :span="9">
                            <h3 class="marT20">日历</h3>
                            <!-- 日历组件 -->
                            <!-- <ve-calendar v-model="selectDateList"></ve-calendar> -->
                            <div class="tableWrapper H410">
                                <calendar-vue-mpvue 
                                @chooseDate = 'getUserCerTimeAndAnnByTime'
                                :cerTimeList = "cerTimeList"
                                :annTimeList = "annTimeList"
                                :sysTimeArr = "sysTimeArr" ></calendar-vue-mpvue>
                                <!-- <calendar-vue-mpvue 
                                @chooseDate = 'getUserCerTimeAndAnnByTime'
                                :cerNameList = "cerNameList" 
                                :cerTimeList = "cerTimeList"
                                :annNameList = "annNameList" 
                                :annTimeList = "annTimeList"
                                :sysTimeArr = "sysTimeArr" ></calendar-vue-mpvue> -->
                            </div>
                        </el-col>
                        <el-col :span="8">
                            <h3 class="marT20 posRelative">提醒事项<icon name="add" class="scaleIcon1 flushIcon svgColor" @click.stop.native = "addTodo"></icon></h3>
                            <div class="tableWrapper H410 todoWrapper">
                                <p class="ellipsis padd10 currDate">当前时间:{{todoObj !== null ? todoObj.currDate : ''}}</p>
                                <ol class="formatP1" v-if = "todoObj !== null && todoObj.result.length > 0">
                                    <li class="clearfix tContent noticeItemNav" v-for="(item,index) of todoObj.result" :key = "item.id">
                                            <p class="fl ellipsis">{{item.name}}</p>
                                            <p class="fr" v-if="item.isBackstageSubmit === 2">
                                                <span title="修改" class="marR15"><icon name="change" class="scaleIcon1 " @click.native.stop="editTodo(item,index)"></icon></span>
                                                <span title="删除"><icon name="del" class="scaleIcon1" @click.native.stop="deleteTodo(item.id,index,item.type,item.time)"></icon></span>
                                            </p>
                                    </li>
                                </ol>
                                
                                <div class="tipNoData" v-else>暂无数据</div>
                            </div>
                        </el-col>
                        <el-col :span="7">
                            <h3 class="marT20 posRelative">今日运势
                                <!-- <span title="刷新星座运势"><icon name="flush" class="scaleIcon1 flushIcon"></icon></span> -->
                            </h3>
                            <div class="tableWrapper H410 borderBox">
                                <div class="tContent formatP">
                                    <dl v-if="constellationObj !== null">
                                        <dt class="clearfix">您的星座：{{constellationObj.constellation}}</dt>
                                        <dt class="clearfix" v-for = "(item,index) of constellationObj.fate_data" :key="index">{{item.name}}{{item.value}}</dt>
                                        <!-- <dt class="clearfix"><span class="fl">爱情运势：</span><span class="fl"><el-rate v-model="value1" disabled></el-rate></span></dt> -->
                                        <dt v-for = "(item,index) of  constellationObj.lucky_object" :key="index">{{item}}</dt>
                                        <dd style="text-indent:2em;" class="marT20">{{constellationObj.analysis}}</dd>
                                    </dl>
                                    <p class="tipNoData" v-else>暂无数据</p>
                                </div>
                            </div>
                        </el-col>
                    </el-row>
                </div>
            </el-col>
            <el-col :span="6">
                <div>
                    <h3 class="marT20 posRelative">通知({{noticeType === 1 ? '通知类' : '制度类'}})<icon name="toggle" class="scaleIcon1 flushIcon" @click.stop.native = "toggleNotice"></icon></h3>
                    <div class="tableWrapper H410 borderBox padd10">
                        <!-- 搜索 -->
                        <div>
                            <el-input v-model.trim="keyword" class="searchTxtInput" placeholder="根据标题或文件编号搜索" maxlength='100' suffix-icon="el-icon-search" @keyup.enter.stop.native = "handleChange"></el-input>
                        </div>
                        <!-- <button  class="operatBtn" @click.stop = "toggleNotice">切换公告</button> -->
                        <!-- 公告 -->
                        <ol class="formatP1" v-if = "noticeReleasedList.length > 0">
                            <li class="clearfix tContent noticeItemNav" v-for="item of noticeReleasedList" :key = "item.id" @click.stop = "viewNoticeFile(item.notice_file_path)">
                                <!-- <router-link   target="_blank"  :to="{path:'noticeDetail', query:{noticeId:item.id}}" class="tContent noticeItemNav"> -->
                                    <span class="fl">{{item.notice_title}}</span>
                                    <span class="fr">{{item.lastNoticeAuditTime}}</span>
                                <!-- </router-link> -->
                            </li>
                        </ol>
                        
                        <div class="tipNoData" v-else>暂无数据</div>
                        <!-- 分页 -->
                        <el-pagination small 
                            v-if = "noticeReleasedList.length > 0"
                            layout="prev, pager, next" 
                            :pager-count="5" 
                            :total="serverPage.totalSize" 
                            @current-change="handleChange"
                            :current-page.sync="serverPage.currPage"
                            :page-size.sync="serverPage.pageSize"
                            class="txtAlignR">
                        </el-pagination>

                    </div>
                </div>
            </el-col>
        </el-row>

        <!-- 个人信息 -->
        <div class="tableWrapper marT20 padd20">
            <el-row :gutter="20">
                <el-tag :type="isBaseMsgShow ? '' : 'warning'" style="cursor:pointer;" @click.stop.native="getBaseMsg">基本信息</el-tag>
                <el-tag :type="isFamMemberShow ? '' : 'warning'" style="cursor:pointer;" @click.stop.native="getFamMember">紧急联系人</el-tag>
                <el-tag :type="isImagesShow ? '' : 'warning'" style="cursor:pointer;" @click.stop.native="getPics">附件</el-tag>
            </el-row>

            <!-- 基本信息 -->
            <el-row class="posRelative marT20" v-show="isBaseMsgShow">
                <icon name="reportError" class="scaleIcon1 reportErrorIcon" title="上报错误"  style="cursor:pointer;"></icon>
                <el-col :span="24">
                    <el-form ref="baseMsgFrm" :model="baseMsgFrm" class="marT10" :inline="true" hide-required-asterisk=true label-width="82px">
                        <el-row>
                            <el-col :span="6">
                                <el-form-item label="工号" prop="staffNum">
                                        <p class="ellipsis" :title="baseMsgFrm.staffNum">{{baseMsgFrm.staffNum}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="组织" prop="organiName">
                                        <p class="ellipsis" :title="baseMsgFrm.organiName">{{baseMsgFrm.organiName === '' ? '/' : baseMsgFrm.organiName}}</p>
                                    </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职位" prop="posName">
                                        <p class="ellipsis" :title="baseMsgFrm.posName">{{baseMsgFrm.posName}}</p>
                                    </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="姓名" prop="userName">
                                    <p class="ellipsis" :title="baseMsgFrm.userName">{{baseMsgFrm.userName}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="性别" prop="userSex">
                                    <p title="男" v-if="baseMsgFrm.userSex === 1">男</p>
                                    <p title="女" v-else>女</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="出生日期" prop="userBirth">
                                    <p class="ellipsis" :title="baseMsgFrm.userBirth">{{baseMsgFrm.userBirth}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="政治面貌" prop="politicalOutlook">
                                    <p class="ellipsis" title="中共党员" v-if="baseMsgFrm.politicalOutlook === 1">中共党员</p>
                                    <p class="ellipsis" title="中共预备党员"  v-else-if="baseMsgFrm.politicalOutlook === 2">中共预备党员</p>
                                    <p class="ellipsis" title="共青团员"  v-else-if="baseMsgFrm.politicalOutlook === 3">共青团员</p>
                                    <p class="ellipsis" title="民革党员"  v-else-if="baseMsgFrm.politicalOutlook === 4">民革党员</p>
                                    <p class="ellipsis" title="民盟盟员"  v-else-if="baseMsgFrm.politicalOutlook === 5">民盟盟员</p>
                                    <p class="ellipsis" title="民建会员"  v-else-if="baseMsgFrm.politicalOutlook === 6">民建会员</p>
                                    <p class="ellipsis" title="民进会员"  v-else-if="baseMsgFrm.politicalOutlook === 7">民进会员</p>
                                    <p class="ellipsis" title="农工党党员"  v-else-if="baseMsgFrm.politicalOutlook === 8">农工党党员</p>
                                    <p class="ellipsis" title="致公党党员"  v-else-if="baseMsgFrm.politicalOutlook === 9">致公党党员</p>
                                    <p class="ellipsis" title="九三学社社员"  v-else-if="baseMsgFrm.politicalOutlook === 10">九三学社社员</p>
                                    <p class="ellipsis" title="台盟盟员"  v-else-if="baseMsgFrm.politicalOutlook === 11">台盟盟员</p>
                                    <p class="ellipsis" title="无党派人士"  v-else-if="baseMsgFrm.politicalOutlook === 12">无党派人士</p>
                                    <p class="ellipsis" title="群众"  v-else-if="baseMsgFrm.politicalOutlook === 13">群众</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="婚姻状况" prop="maritalStatus">
                                    <p title="未婚" v-if="baseMsgFrm.maritalStatus === 1">未婚</p>
                                    <p title="已婚" v-else-if="baseMsgFrm.maritalStatus === 2">已婚</p>
                                    <p title="其它" v-else-if="baseMsgFrm.maritalStatus === 3">其它</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="健康状况" prop="health">
                                    <p title="健康" v-if="baseMsgFrm.health === 1">健康</p>
                                    <p title="良好" v-else-if="baseMsgFrm.health === 2">残疾</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="籍贯" prop="nativePlace">
                                    <p class="ellipsis" :title="baseMsgFrm.nativePlace">{{baseMsgFrm.nativePlace}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="邮箱" prop="userEmail">
                                    <p class="ellipsis" :title="baseMsgFrm.userEmail">{{baseMsgFrm.userEmail}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="QQ" prop="qq">
                                    <p class="ellipsis" :title="baseMsgFrm.qq">{{baseMsgFrm.qq}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="民族" prop="nation">
                                    <p title="汉族" v-if="baseMsgFrm.nation=== 1">汉族</p>
                                    <p title="蒙古族" v-else-if="baseMsgFrm.nation=== 2">蒙古族</p>
                                    <p title="回族" v-else-if="baseMsgFrm.nation=== 3">回族</p>
                                    <p title="藏族" v-else-if="baseMsgFrm.nation=== 4">藏族</p>
                                    <p title="维吾尔族" v-else-if="baseMsgFrm.nation=== 5">维吾尔族</p>
                                    <p title="苗族" v-else-if="baseMsgFrm.nation=== 6">苗族</p>
                                    <p title="彝族" v-else-if="baseMsgFrm.nation=== 7">彝族</p>
                                    <p title="壮族" v-else-if="baseMsgFrm.nation=== 8">壮族</p>
                                    <p title="布衣族" v-else-if="baseMsgFrm.nation=== 9">布衣族</p>
                                    <p title="朝鲜族" v-else-if="baseMsgFrm.nation=== 10">朝鲜族</p>
                                    <p title="满族" v-else-if="baseMsgFrm.nation=== 11">满族</p>
                                    <p title="侗族" v-else-if="baseMsgFrm.nation=== 12">侗族</p>
                                    <p title="瑶族" v-else-if="baseMsgFrm.nation=== 13">瑶族</p>
                                    <p title="白族" v-else-if="baseMsgFrm.nation=== 14">白族</p>
                                    <p title="土家族" v-else-if="baseMsgFrm.nation=== 15">土家族</p>
                                    <p title="哈尼族" v-else-if="baseMsgFrm.nation=== 16">哈尼族</p>
                                    <p title="哈萨克族" v-else-if="baseMsgFrm.nation=== 17">哈萨克族</p>
                                    <p title="傣族" v-else-if="baseMsgFrm.nation=== 18">傣族</p>
                                    <p title="黎族" v-else-if="baseMsgFrm.nation=== 19">黎族</p>
                                    <p title="傈僳族" v-else-if="baseMsgFrm.nation=== 20">傈僳族</p>
                                    <p title="佤族" v-else-if="baseMsgFrm.nation=== 21">佤族</p>
                                    <p title="畲族" v-else-if="baseMsgFrm.nation=== 22">畲族</p>
                                    <p title="高山族" v-else-if="baseMsgFrm.nation=== 23">高山族</p>
                                    <p title="拉祜族" v-else-if="baseMsgFrm.nation=== 24">拉祜族</p>
                                    <p title="水族" v-else-if="baseMsgFrm.nation=== 25">水族</p>
                                    <p title="东乡族" v-else-if="baseMsgFrm.nation=== 26">东乡族</p>
                                    <p title="纳西族" v-else-if="baseMsgFrm.nation=== 27">纳西族</p>
                                    <p title="景颇族" v-else-if="baseMsgFrm.nation=== 28">景颇族</p>
                                    <p title="柯尔克孜" v-else-if="baseMsgFrm.nation=== 29">柯尔克孜</p>
                                    <p title="土族" v-else-if="baseMsgFrm.nation=== 30">土族</p>
                                    <p title="达斡尔族" v-else-if="baseMsgFrm.nation=== 31">达斡尔族</p>
                                    <p title="仫佬族" v-else-if="baseMsgFrm.nation=== 32">仫佬族</p>
                                    <p title="羌族" v-else-if="baseMsgFrm.nation=== 33">羌族</p>
                                    <p title="布朗族" v-else-if="baseMsgFrm.nation=== 34">布朗族</p>
                                    <p title="撒拉族" v-else-if="baseMsgFrm.nation=== 35">撒拉族</p>
                                    <p title="毛难族" v-else-if="baseMsgFrm.nation=== 36">毛难族</p>
                                    <p title="仡佬族" v-else-if="baseMsgFrm.nation=== 37">仡佬族</p>
                                    <p title="锡伯族" v-else-if="baseMsgFrm.nation=== 38">锡伯族</p>
                                    <p title="阿昌族" v-else-if="baseMsgFrm.nation=== 39">阿昌族</p>
                                    <p title="普米族" v-else-if="baseMsgFrm.nation=== 40">普米族</p>
                                    <p title="塔吉克族" v-else-if="baseMsgFrm.nation=== 41">塔吉克族</p>
                                    <p title="怒族" v-else-if="baseMsgFrm.nation=== 42">怒族</p>
                                    <p title="乌孜别克" v-else-if="baseMsgFrm.nation=== 43">乌孜别克</p>
                                    <p title="俄罗斯族" v-else-if="baseMsgFrm.nation=== 44">俄罗斯族</p>
                                    <p title="鄂温克族" v-else-if="baseMsgFrm.nation=== 45">鄂温克族</p>
                                    <p title="崩龙族" v-else-if="baseMsgFrm.nation=== 46">崩龙族</p>
                                    <p title="保安族" v-else-if="baseMsgFrm.nation=== 47">保安族</p>
                                    <p title="裕固族" v-else-if="baseMsgFrm.nation=== 48">裕固族</p>
                                    <p title="京族" v-else-if="baseMsgFrm.nation=== 49">京族</p>
                                    <p title="塔塔尔族" v-else-if="baseMsgFrm.nation=== 50">塔塔尔族</p>
                                    <p title="独龙族" v-else-if="baseMsgFrm.nation=== 51">独龙族</p>
                                    <p title="鄂伦春族" v-else-if="baseMsgFrm.nation=== 52">鄂伦春族</p>
                                    <p title="赫哲族" v-else-if="baseMsgFrm.nation=== 53">赫哲族</p>
                                    <p title="门巴族" v-else-if="baseMsgFrm.nation=== 54">门巴族</p>
                                    <p title="珞巴族" v-else-if="baseMsgFrm.nation=== 55">珞巴族</p>
                                    <p title="基诺族" v-else-if="baseMsgFrm.nation=== 56">基诺族</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职称" prop="userTitle">
                                    <p class="ellipsis" :title="baseMsgFrm.userTitle">{{baseMsgFrm.userTitle}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="联系电话" prop="userTel">
                                    <p class="ellipsis" :title="baseMsgFrm.userTel">{{baseMsgFrm.userTel}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="身份证号" prop="userCardNo">
                                    <p class="ellipsis" :title="baseMsgFrm.userCardNo">{{baseMsgFrm.userCardNo}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="户籍地址" prop="perAddress">
                                    <p class="ellipsis" :title="baseMsgFrm.perAddress">{{baseMsgFrm.perAddress}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="常住地址" prop="concatAddress">
                                    <p class="ellipsis" :title="baseMsgFrm.concatAddress">{{baseMsgFrm.concatAddress}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="毕业学校" prop="gradSchool">
                                    <p class="ellipsis" :title="baseMsgFrm.gradSchool">{{baseMsgFrm.gradSchool}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="毕业时间" prop="gradTime">
                                    <p class="ellipsis" :title="baseMsgFrm.gradTime">{{baseMsgFrm.gradTime}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="学历" prop="education">
                                    <p class="ellipsis" title="/" v-if="baseMsgFrm.education === ''">/</p>
                                    <p class="ellipsis" title="初中及以下" v-else-if="baseMsgFrm.education === 1">初中及以下</p>
                                    <p class="ellipsis" title="高中" v-else-if="baseMsgFrm.education === 2">高中</p>
                                    <p class="ellipsis" title="专科" v-else-if="baseMsgFrm.education === 3">专科</p>
                                    <p class="ellipsis" title="本科(成教)" v-else-if="baseMsgFrm.education === 4">本科(成教)</p>
                                    <p class="ellipsis" title="本科(民办 / 自考)" v-else-if="baseMsgFrm.education === 5">本科(民办 / 自考)</p>
                                    <p class="ellipsis" title="本科(二本)" v-else-if="baseMsgFrm.education === 6">本科(二本)</p>
                                    <p class="ellipsis" title="本科(一本)" v-else-if="baseMsgFrm.education === 7">本科(一本)</p>
                                    <p class="ellipsis" title="本科(211)" v-else-if="baseMsgFrm.education === 8">本科(211)</p>
                                    <p class="ellipsis" title="本科(985)" v-else-if="baseMsgFrm.education === 9">本科(985)</p>
                                    <p class="ellipsis" title="硕士 / 工硕" v-else-if="baseMsgFrm.education === 10">硕士 / 工硕</p>
                                    <p class="ellipsis" title="博士" v-else-if="baseMsgFrm.education === 11">博士</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="专业" prop="professName">
                                    <p class="ellipsis" :title="baseMsgFrm.professName === '' ? '/' : baseMsgFrm.professName">{{baseMsgFrm.professName === '' ? '/' : baseMsgFrm.gradSchool}}</p>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-col>
            </el-row>

            <!-- 紧急联系人 -->
            <div class="marT20" v-show="isFamMemberShow">
                <el-table 
                    :data="memberList"
                    border
                    style="width: 100%">
                    <el-table-column
                    align="center"
                    prop="memberCall"
                    label="称呼">
                    </el-table-column>
                    <el-table-column
                    align="center"
                    prop="memberName"
                    label="姓名">
                    </el-table-column>
                    <el-table-column
                    align="center"
                    prop="memberTel"
                    label="电话">
                    </el-table-column>
                    <el-table-column
                    align="center"
                    label="操作">
                    <template slot-scope="scope">
                        <icon name="reportError" class="scaleIcon1" title="上报错误" @click.native.stop="reportError(scope.$index,scope.row)" style="cursor:pointer;"></icon>
                    </template>
                    </el-table-column>
                </el-table>
            </div>

            <!-- 附件 -->
            <el-tabs type="border-card" @tab-click="getPics"  v-model="editableTabsValue" v-show="isImagesShow" class="marT20" ref="picTabs">
                <el-tab-pane label="简历" name = 1>
                    <photo-wall :images = "images"></photo-wall>
                </el-tab-pane>
                <el-tab-pane label="身份证" name = 2>
                    <photo-wall :images = "images" key = 2></photo-wall>
                </el-tab-pane>
                <el-tab-pane label="职称证书" name = 3>
                    <photo-wall :images = "images"></photo-wall>
                </el-tab-pane>
                <el-tab-pane label="学历证书" name = 6>
                    <photo-wall :images = "images"></photo-wall>
                </el-tab-pane>
                <el-tab-pane label="建行卡" name = 7>
                   <photo-wall :images = "images"></photo-wall>
                </el-tab-pane>
                <el-tab-pane label="驾驶证" name = 8>
                    <photo-wall :images = "images"></photo-wall>
                </el-tab-pane>
                <el-tab-pane label="行驶证" name = 9>
                    <photo-wall :images = "images"></photo-wall>
                </el-tab-pane>
                <el-tab-pane label="交强险" name = 10>
                    <photo-wall :images = "images"></photo-wall>
                </el-tab-pane>
                <el-tab-pane label="商业险" name = 11>
                    <photo-wall :images = "images"></photo-wall>
                </el-tab-pane>
            </el-tabs>

        </div>

        <!-- 提醒日期弹框 -->
        <el-dialog
            :title="todoDialogTitle"
            fullscreen = true
            :visible.sync="isTodoDialogShow"
            width="30%"
            :before-close="cancelTodo"
            center>
            <el-form ref="todoFrm" :model="todoFrm" :rules="todoFrmRules" class="marT10" :inline="true" hide-required-asterisk=true label-width="80px">
                <el-row>
                    <el-col :span="6" :lg="8" :md="12">
                        <el-form-item label="提醒日期" prop="annTime">
                            <el-input v-model.trim="todoFrm.annTime" class="inputTxtWrapper" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6" :lg="8" :md="12">
                        <el-form-item label="提醒内容" prop="annName">
                            <el-input v-model.trim="todoFrm.annName" placeholder="请输入提醒内容" maxlength='50' class="inputTxtWrapper"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="cancelTodo">取 消</el-button>
                <el-button type="primary" @click="sureTodo">确 定</el-button>
            </span>
        </el-dialog>

    </div>
</template>

<script>
// import veCalendar from "ve-calendar"
import http from '@/assets/js/http'
import _g from '@/assets/js/global'
import config from '@/assets/js/config.js'
import Cookies from "js-cookie"
// import constellation from '@/assets/js/data'//  12星座

// import calendarVueMpvue from '../../Common/calendarVueMpvue'
import calendarVueMpvue from '@/components/guest/Common/calendarVueMpvue'
import photoWall from '../../Common/photoWall'



export default {
    data(){
        return{

tableData: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          }, {
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1517 弄'
          }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1519 弄'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
          }],

            // constellation,//    所有星座信息

            /* 日历 */
            sysTimeArr : [],//  系统时间
            birth:'',//..登录人员生日
            constellationName : '',//   星座名称
            constellationObj : null,

            annTimeList : [],// 提醒日期
            // annNameList : [],// 提醒日期
            cerTimeList : [],// 证件有效期
            todoDialogTitle : '新建提醒',// 提醒弹框标题
            // cerNameList : [],// 证件有效期

            // 星座运势
            currConstellation : {},//   当前星座

            // 代办事项
            todoObj : null,
            isTodoDialogShow : false,// 代办事项弹框默认隐藏
            todoFrm : {                         //  代办事项弹框表单
                annId : null,// 所属提醒日期id
                index :null,//  所属提醒日期索引
                annTime: '',//提醒日期
                annName:'',//提醒日期内容不能为空
                annTimeNoLeader0:'',//  没有前导0的日期
            },



            noticeReleasedList : [],//  通知
            serverPage:{                                                                                              //  后台分页                                    
                pageSize:12,                 //  每页显示10个
                totalSize:0,                 //  总记录数
                currPage:1,                    //  当前页码 
            },  
            noticeType : 1,//   1通知类，2制度类
			
			 keyword : '',    //  模糊搜索关键词

            /* 基本信息 */
            isBaseMsgShow:false,//    基本信息版块默认隐藏
            baseMsgFrm:{
                staffNum : '',                                                      //  工号
                organiName:'',                                                              //..组织
                posName:'',                                                              //..职位

                userName:'',//..姓名
                userSex:1, //..性别
                userBirth:'',//..出生年月
                politicalOutlook:13,       //  政治面貌
                maritalStatus:1,       //  婚姻状况
                health:1,                   //  健康状况
                nativePlace:'',         //..籍贯
                userEmail:'',       //..邮箱
                qq:'',                //  QQ       
                nation:1,           //  民族              
                userTitle:'',   //..职称
                userTel:'',     //..联系电话
                userCardNo:'',      //..身份证号
                perAddress:'',      //..户籍所在地
                concatAddress:'',      //..联系地址
                gradSchool:'',  //  毕业学校
                gradTime:'',  //  毕业时间
                education:'',  //  学历
                professName:'',  //  专业
            },

            /* 紧急联系人 */
            isFamMemberShow:false,//    紧急联系人版块默认隐藏
            memberList : [],
             memberFrm:{//  紧急联系人表单
                memberCall:'',  //  称呼
                memberName:'',  //  姓名
                memberTel:'',  //  电话
            },
            isMemberFrmShow:false,                                      //  默认隐藏紧急联系人表单
             isAddorEdit:true,                                                   //  默认为确认提交按钮
            currEditorMember:{
                memberId:null,                                              //  当前修改的紧急联系人的id
                index:null,                                              //  当前修改的紧急联系人的数组索引
            },
             isMemberFrmOk:false,// 表单默认没有通过校验


            /* 附件 */
            isImagesShow:false,//    附件版块默认隐藏
            images:[],
            editableTabsValue : '1',//    默认选中简历

             // 紧急联系人校验
            memberRules:{
                memberCall: [{
                        required: true,
                        message: "请输入称呼",
                        trigger: "blur"
                    }
                ],
                memberTel: [{
                        required: true,
                        message: "请输入联系电话",
                        trigger: "blur"
                    }
                ],
                
                memberName: [{
                        required: true,
                        message: "请输入姓名",
                        trigger: "blur"
                    },
                ]
            },

            // 提醒日期校验
            todoFrmRules:{
                // annTime: [{
                //         required: true,
                //         message: "请输入提醒日期",
                //         trigger: "blur"
                //     }
                // ],
                annName: [{
                        required: true,
                        message: "请输入提醒内容",
                        trigger: "blur"
                    }
                ],
            },
        }
    },
    components: {
        // veCalendar,
        calendarVueMpvue,
        photoWall
    },
    created () {
        this.getBaseMsg()
        this.getLoginUserCalendar()
        this.getAllCerTimeAndAnn()
        this.getAllPagingReleasedNotice()
        this.getUserCerTimeAndAnnByTime()
        this.getConstellationMsg()

        // this.apiPost(config.javaServerUrl,{codeId : 'C00000'}).then((res) => {
        // })
    },
    methods: {
        /* 提醒日期弹框关闭 */
        cancelTodo(){
            if(this.isTodoDialogShow){
                this.$refs.todoFrm.clearValidate()
            }
            this.isTodoDialogShow = false//   提醒日期弹框隐藏
            this.todoFrm.index = null
            this.todoFrm.addId = null
            this.todoFrm.annId = null
            this.todoFrm.annName = ''
            this.todoFrm.annTimeNoLeader0  = ''
        },
        /* 删除代办事项 */
        deleteTodo(id,index,type,todoItemTime){
            const that = this
            that.$confirm('是否确认删除?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    if(type === 2){//    如果为提醒日期代办事项
                        that.deleteAnn(id,index,todoItemTime)
                    }
                }).catch(() => {})
        },
        /* 删除提醒日期代办事项 */
        deleteAnn(annId,index,todoItemTime){
            const that = this
            let result = that.todoObj.result
            let todoItemTimeArr = []
            let todoItemTimeNoLeadr0 = ''
            let annTimeList = []
            _g.showLoading('删除中')
            that.apiPost('/admin/ann/delete', {annId}).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){
                        _g.toastMsg("success", res.message)
                        result.splice(index,1)  // 从代办事项列表中移除   
                        that.todoObj.result = result 
                        if(that.todoObj.result.length <= 0){//  如果当前日期已经没有代办事项
                            todoItemTimeArr = todoItemTime.split('-')
                            todoItemTimeNoLeadr0 = parseInt(todoItemTimeArr[0]) + '-' + parseInt(todoItemTimeArr[1]) + '-' + parseInt(todoItemTimeArr[2])
                            annTimeList = that.annTimeList.filter(val => val !== todoItemTimeNoLeadr0)//  总的提醒日期列表中移除该时间
                            that.annTimeList = annTimeList
                        }
                    }else if(res.data.isSuccess === 1){
                        _g.toastMsg("error", res.message)
                    }
                }
        })
        },

         /* 新增提醒日期 */
        addTodo(item){
            this.todoDialogTitle = '新增提醒'
            this.isTodoDialogShow = true//    提醒日期弹框显示
        },

         /* 编辑提醒日期 */
        editTodo(item,index){
            this.todoFrm.annId = item.id
            this.todoFrm.index = index
            this.todoFrm.annTime = item.time
            this.todoFrm.annName = item.name
            this.todoDialogTitle = '编辑提醒'
            this.isTodoDialogShow = true//    提醒日期弹框显示
        },
        
        /* 确认新增提醒日期 */
        sureTodo(){
            const that = this
            
            let annTimeArr = []

            let annTimeNoLeader0 = ''

            const index = this.todoFrm.index

            const data = that.todoFrm

            console.log(that.todoObj.currDate)
            console.log(data)

            that.$refs['todoFrm'].validate(valid => {
                if (valid) {
                    annTimeArr   =   that.todoFrm.annTime.split('-')
                    annTimeNoLeader0 = annTimeArr[0] + '-' + parseInt(annTimeArr[1]) + '-' + parseInt(annTimeArr[2])

                    data.annTimeNoLeader0 = annTimeNoLeader0
                    data.isBackstageSubmit = 2

                        that.$confirm('是否确认?', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning',
                            center: true
                        }).then(() => {
                                _g.showLoading('提交中')
                                that.apiPost('/admin/ann/add',data).then((res) => {
                                _g.showLoading().close()
                                if(typeof res === 'string'){
                                        res = JSON.parse(res)
                                    }
                                    if (res.code != 200) {
                                        that.handleError(res)
                                    } else {
                                        if(res.data.isSuccess === 0){
                                            _g.toastMsg("success", res.message)
                                            if(data.annId === null){//  新增
                                                // that.annNameList = [].concat(that.annNameList,[data.annName])
                                                that.annTimeList.push(data.annTimeNoLeader0)

                                                
                                                if(data.annTime === that.todoObj.currDate){//   如果在选中日期追加待办事项
                                                    that.todoObj.result.push({
                                                        id: res.data.id,
                                                        type: 2,
                                                        time: data.annTime,
                                                        name: data.annName,
                                                        isBackstageSubmit: 2
                                                    })
                                                }
                                            }else{//    编辑
                                                if(data.annTime === that.todoObj.currDate){//   如果在选中日期修改待办事项
                                                    that.todoObj.result[index].time = data.annTime
                                                    that.todoObj.result[index].name = data.annName
                                                }
                                            }
                                            

                                            that.cancelTodo()
                                            console.log('1* = ',that.todoFrm)

                                        }else if(res.data.isSuccess === 1){
                                            _g.toastMsg("error", res.message)
                                        }else if(res.data.isSuccess === 2){
                                            _g.toastMsg("warning", res.message)
                                            that.cancelTodo()
                                        }
                                    }
                            })
                        }).catch(() => {})
                    
                }
            })
        },
        /* 查询星座运势 */
        getConstellationMsg(str){
            const that = this
            const constellation = [
                { name: '水瓶座' ,startTime : '01-20',endTime:'02-18'},
                { name: '双鱼座' ,startTime : '02-19',endTime:'03-20'},
                { name: '白羊座' ,startTime : '03-21',endTime:'04-19'},
                { name: '金牛座' ,startTime : '04-20',endTime:'05-20'},
                { name: '双子座' ,startTime : '05-21',endTime:'06-21'},
                { name: '巨蟹座' ,startTime : '06-22',endTime:'07-22'},
                { name: '狮子座' ,startTime : '07-23',endTime:'08-22'},
                { name: '处女座' ,startTime : '08-23',endTime:'09-22'},
                { name: '天秤座' ,startTime : '09-23',endTime:'10-23'},
                { name: '天蝎座' ,startTime : '10-24',endTime:'11-22'},
                { name: '射手座' ,startTime : '11-23',endTime:'12-21'},
                { name: '魔羯座' ,startTime : '12-22',endTime:'01-19'},
                ]
            let constellationName = ''//    星座名称
            for(let item of constellation){
                if(new Date(str).getTime() >= new Date(item.startTime).getTime() && new Date(str).getTime() <= new Date(item.endTime).getTime()){
                    constellationName = item.name
                    break
                }
            }
            that.constellationName = constellationName
            axios.get('http://' + config.proServerUrl + '/apis/?appid=70e01a921a27ea4135da9980c5082eaf&constellation=' + constellationName)
            .then(function (res) {
                if(res.data.error_code == 0){//    成功
                    that.constellationObj = res.data.data
                }else{//    失败
                    _g.toastMsg('error',res.reason)
                }
            })
            .catch(function (error) {
                console.log(error);
            });

        },
        /* 查看公告附件 */
        viewNoticeFile(noticeFilePath){
            window.open(noticeFilePath)
        },
        /* 切换公告 */
        toggleNotice(){
            // 重置为初始信息
            this.noticeReleasedList = []
            this.keyword = ''
            this.serverPage.currPage = 1
            this.noticeType = this.noticeType === 1 ? 2 : 1    
            this.getAllPagingReleasedNotice()
        },
         /* 分页 */
        handleChange(){
            this.getAllPagingReleasedNotice()
        },

        /* 获取登录用户日历相关信息 */
        getLoginUserCalendar(){
            const that = this
            // let annNameList =  that.annNameList
            let annTimeList =  that.annTimeList
             _g.showLoading('加载中')
            that.apiPost('admin/users/getLoginUserCalendar').then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){             //  成功
                        that.sysTimeArr = res.data.sysTime.split('-')
                        if(res.data.birth !== ''){
                            // that.birth = res.data.birth
                            let arr = res.data.birth.split('-')
                            // that.annNameList = [].concat(annNameList,['我的生日'])
                            that.annTimeList = [].concat(annTimeList,[arr[0] +'-' + parseInt(arr[1]) + '-' + parseInt(arr[2])])

                            // 获取星座运势
                            that.getConstellationMsg(arr[1] + '-' + arr[2])
                        }
                    }else{
                        _g.toastMsg("error", res.message)
                    }
                }
            })
        },

        /* 分页模糊查询当前登录用户的已经发布的公告 */
        getAllPagingReleasedNotice(){
            const that = this
            const noticeType = that.noticeType//    当前公告类型，1通知类，2制度类
            const data = {
                ...that.serverPage,
                keyword :  that.keyword,
                noticeType
            }

             _g.showLoading('加载中')
            that.apiPost('admin/notice/getAllPagingReleasedNotice',data).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){             //  成功
                        if(noticeType === 1){// 通知类
                            if(res.data.noticeList !== null){
                                that.noticeReleasedList = res.data.noticeList.data
                                that.serverPage.totalSize = res.data.noticeList.total
                            }
                        }else if(noticeType === 2){//   制度类
                            if(res.data.systemNoticeList !== null){
                                that.noticeReleasedList = res.data.systemNoticeList.data
                                that.serverPage.totalSize = res.data.systemNoticeList.total
                            }
                        }
                        
                    }else{
                        _g.toastMsg("error", res.message)
                    }
                }
            })
        },

        /* 向管理员报错 */
        reportError(index,row){
        },
        /* 批量重置标签对应各版块隐藏 */
        resetTagModuleHide(){
            this.isBaseMsgShow = false
            this.isFamMemberShow = false
            this.isImagesShow = false
        },
         /* 根据用户id查询用户基本信息 */
        getBaseMsg(){
            const that = this
            const organiNameArr = []

            if(!that.isBaseMsgShow){//    如果隐藏
                _g.showLoading('加载中')
                that.apiPost('admin/users/queryBaseMsgByUserId').then((res) => {
                    _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                            that.resetTagModuleHide()

                            // 基本信息初始化
                            that.baseMsgFrm.staffNum = res.data.userBaseInfo.staffnum
                            that.baseMsgFrm.posName = res.data.userBaseInfo.post.pos_name

                            for(let item of res.data.userBaseInfo.infiniteLevelStructure){
                                organiNameArr.push(item.label)
                            }
                            that.baseMsgFrm.organiName = organiNameArr.length > 0 ? organiNameArr.join(' / ') : ''

                            that.baseMsgFrm.userName = res.data.userBaseInfo.user_name
                            that.baseMsgFrm.userSex = res.data.userBaseInfo.user_sex
                            that.baseMsgFrm.userBirth = res.data.userBaseInfo.date_birth
                            that.baseMsgFrm.politicalOutlook = res.data.userBaseInfo.political_outlook
                            that.baseMsgFrm.maritalStatus = res.data.userBaseInfo.marital_status
                            that.baseMsgFrm.health = res.data.userBaseInfo.health
                            that.baseMsgFrm.nativePlace = res.data.userBaseInfo.native_place
                            that.baseMsgFrm.userEmail = res.data.userBaseInfo.user_email === null ? '' : res.data.userBaseInfo.user_email
                            that.baseMsgFrm.qq = res.data.userBaseInfo.user_qq === null ? '' : res.data.userBaseInfo.user_qq
                            that.baseMsgFrm.nation = res.data.userBaseInfo.nation
                            that.baseMsgFrm.userTitle = res.data.userBaseInfo.user_title === null ? '' : res.data.userBaseInfo.user_title
                            that.baseMsgFrm.userTel = res.data.userBaseInfo.user_tel
                            that.baseMsgFrm.userCardNo = res.data.userBaseInfo.user_card_num
                            that.baseMsgFrm.perAddress = res.data.userBaseInfo.per_address
                            that.baseMsgFrm.concatAddress = res.data.userBaseInfo.concat_address
                            that.baseMsgFrm.gradSchool = res.data.userBaseInfo.grad_school === null ? res.data.userBaseInfo.ini_school : res.data.userBaseInfo.grad_school
                            that.baseMsgFrm.gradTime = res.data.userBaseInfo.grad_time === null ? res.data.userBaseInfo.ini_grad_time : res.data.userBaseInfo.grad_time

                            that.baseMsgFrm.education = res.data.userBaseInfo.education === null ? '' : res.data.userBaseInfo.education
                            that.baseMsgFrm.professName = res.data.userBaseInfo.professional_name === null ? '' : res.data.userBaseInfo.professional_name

                            that.isBaseMsgShow = true
                        }else{
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }
        },
         /* 根据用户id查询紧急联系人 */
        getFamMember(){
            const that = this
            let memberList = []
            if(!that.isFamMemberShow){//    如果隐藏
                _g.showLoading('加载中')
                that.apiPost('admin/resume/queryMemberByUserId').then((res) => {
                     _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                            that.resetTagModuleHide()

                            // 紧急联系人初始化
                            for(let member of res.data.memberList){
                                memberList.push({
                                    memberId : member.id,
                                    memberCall : member.member_call,
                                    memberName : member.member_name,
                                    memberTel : member.member_tel,
                                })
                            }
                            that.memberList = memberList
                            that.isFamMemberShow = true
                        }else{
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }
        },
        iniPics(){
            // this.resetTagModuleHide()
            // this.isImagesShow = true
        },
        /* 获取附件 */
        getPics(){
            const that = this
            let imgList = []
            that.images = []
            const type = that.editableTabsValue

            _g.showLoading('加载中')
            that.apiPost('admin/resume/queryResumePicsByUserId', {type}).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){             //  成功
                        that.resetTagModuleHide()

                        for(let item of res.data.resumeFileList){
                            imgList.push({
                                    name : item.resume_file_name,
                                    url : item.resume_file_path,
                                    response : {
                                        data : {
                                            fileId : item.id
                                        }
                                    }      
                                })
                        }
                        that.images =  [].concat(imgList)
                        that.isImagesShow = true
                        that.$previewRefresh()////如果图片是异步生成的，在图片数据更新后调用
                    }else{
                        _g.toastMsg("error", res.message)
                    }
                }
            })

        },

        /* 侦听表单改变与校验是否通过 */ 
        watchFrmChange(frmName){
            switch (frmName){
                case 'memberFrm':
                    this.isMemberFrmOk = true
                    break
            }
        },

        /* 查询某人所有附件有效期和提醒日期 */
        getAllCerTimeAndAnn(){
            const that = this
            let annList = []
             let annTimeList = []// 提醒日期
            let cerTimeList = []// 证件有效期

            let tmpMonth = null
            let tmpDay = null

            _g.showLoading('加载中')
            that.apiPost('admin/cerTime/getAllCerTimeAndAnn').then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){             //  成功
                        // 附件有效期初始化
                        for(let item of res.data.cerTimeList){
                            tmpMonth = null
                            tmpDay = null
                            if(item.cer_type === 1){//  身份证
                                // cerNameList.push('身份证')
                                if(item.cer_end_time.slice(5,6) === '0'){
                                    tmpMonth = item.cer_end_time.slice(6,7)
                                }else{
                                    tmpMonth = item.cer_end_time.slice(5,7)
                                }
                                if(item.cer_end_time.slice(8,9) === '0'){
                                    tmpDay = item.cer_end_time.slice(9)
                                }else{
                                    tmpDay = item.cer_end_time.slice(5,7)
                                }
                                cerTimeList.push(item.cer_end_time.slice(0,4) +'-' +tmpMonth + '-' + tmpDay)
                            }else if(item.cer_type === 2){//    驾驶证
                                // cerNameList.push('驾驶证')
                                if(item.cer_end_time.slice(5,6) === '0'){
                                    tmpMonth = item.cer_end_time.slice(6,7)
                                }else{
                                    tmpMonth = item.cer_end_time.slice(5,7)
                                }
                                if(item.cer_end_time.slice(8,9) === '0'){
                                    tmpDay = item.cer_end_time.slice(9)
                                }else{
                                    tmpDay = item.cer_end_time.slice(8)
                                }
                                cerTimeList.push(item.cer_end_time.slice(0,4) +'-' +tmpMonth + '-' + tmpDay)
                            }else if(item.cer_type === 3 && item.cer_end_time !== null){//    行驶证
                                // cerNameList.push('行驶证')
                                if(item.cer_end_time.slice(5,6) === '0'){
                                    tmpMonth = item.cer_end_time.slice(6,7)
                                }else{
                                    tmpMonth = item.cer_end_time.slice(5,7)
                                }
                                if(item.cer_end_time.slice(8,9) === '0'){
                                    tmpDay = item.cer_end_time.slice(9)
                                }else{
                                    tmpDay = item.cer_end_time.slice(8)
                                }
                                cerTimeList.push(item.cer_end_time.slice(0,4) +'-' +tmpMonth + '-' + tmpDay)
                            }else if(item.cer_type === 4){//    交强险
                                // cerNameList.push('交强险')
                                if(item.cer_end_time.slice(5,6) === '0'){
                                    tmpMonth = item.cer_end_time.slice(6,7)
                                }else{
                                    tmpMonth = item.cer_end_time.slice(5,7)
                                }
                                if(item.cer_end_time.slice(8,9) === '0'){
                                    tmpDay = item.cer_end_time.slice(9)
                                }else{
                                    tmpDay = item.cer_end_time.slice(8)
                                }
                                cerTimeList.push(item.cer_end_time.slice(0,4) +'-' +tmpMonth + '-' + tmpDay)
                            }else if(item.cer_type === 5){//    商业险
                                // cerNameList.push('商业险')
                                if(item.cer_end_time.slice(5,6) === '0'){
                                    tmpMonth = item.cer_end_time.slice(6,7)
                                }else{
                                    tmpMonth = item.cer_end_time.slice(5,7)
                                }
                                if(item.cer_end_time.slice(8,9) === '0'){
                                    tmpDay = item.cer_end_time.slice(9)
                                }else{
                                    tmpDay = item.cer_end_time.slice(8)
                                }
                                cerTimeList.push(item.cer_end_time.slice(0,4) +'-' +tmpMonth + '-' + tmpDay)
                            }
                        }

                        that.cerTimeList = cerTimeList
                        // that.cerNameList = cerNameList

                        tmpMonth = null
                        tmpDay = null
                        // 提醒日期初始化
                        for(let item of res.data.annList){
                            if(item.ann_time.slice(5,6) === '0'){
                                tmpMonth = item.ann_time.slice(6,7)
                            }else{
                                tmpMonth = item.ann_time.slice(5,7)
                            }
                            if(item.ann_time.slice(8,9) === '0'){
                                tmpDay = item.ann_time.slice(9)
                            }else{
                                tmpDay = item.ann_time.slice(8)
                            }
                            annTimeList.push(item.ann_time.slice(0,4) +'-' +tmpMonth + '-' + tmpDay)
                        }
                        that.annTimeList = [].concat(that.annTimeList,annTimeList)
                    }else{
                        _g.toastMsg("error", res.message)
                    }
                }
            })
        },

        /* 根据年月日查询某人所有附件有效期和提醒日期代办事项 */
        getUserCerTimeAndAnnByTime(checkedTime){
            const that = this
            let time = ''

            _g.showLoading('加载中')
            if(checkedTime === undefined){//    初始默认加载
                that.apiPost('admin/cerTime/getUserCerTimeAndAnnByTime').then((res) => {
                    _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                            that.todoObj = res.data
                            that.todoFrm.annTime = res.data.currDate
                        }else{
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }else{//    根据选中日期加载
                checkedTime.m = checkedTime.m.length < 2 ? ('0' + checkedTime.m) : checkedTime.m
                checkedTime.d = checkedTime.d.length < 2 ? ('0' + checkedTime.d) : checkedTime.d
                time = checkedTime.y + '-' + checkedTime.m + '-' + checkedTime.d
                that.todoFrm.annTime = time
                that.apiPost('admin/cerTime/getUserCerTimeAndAnnByTime',{time}).then((res) => {
                    _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){             //  成功
                            that.todoObj = res.data
                        }else{
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }
            that.cancelTodo()
        },
    },
    mixins: [http]
}
</script>

<style lang="less" scoped>
h3{
    font-size: 14px;
    color: #ef8200;
    padding-bottom: 10px;
    .flushIcon{
        position: absolute;
        right: 6px;
        cursor: pointer;
    }
}
.borderBox{
    box-sizing: border-box;
}

.todoWrapper{
    overflow-y: auto;
    box-sizing: border-box;
    .currDate{
        margin-top:10px;
    }
}

.formatP{
    line-height: 24px;
    padding: 10px;
    overflow-y: auto;
    box-sizing: border-box;
    height: calc(100% - 2px);
}

.formatP1{
    line-height: 24px;
    padding: 10px;
    box-sizing: border-box;
}
.noticeItemNav{
    display: block;
    cursor: pointer;
}
.noticeItemNav:hover{
    color: #ef8200;
}

.wrapper{
    width: calc(100% - 105px);
    display: inline-block;
}

/* 侧边表单 */

.dmAsideBg{
   position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(55, 55, 55, 0.6);
    height: 100%;
    z-index: 1000; 
}
.dmAsideWrapper{
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 1000;
    overflow: auto;
    background: #fff;
    right: 0;
    left: auto;
    width: 490px;
    padding: 40px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* 按钮 */
.btnsWrapper{
    position: fixed;
    bottom: 0;
    right: 245px;
    transform: translateX(50%);
    width: 490px;
    text-align: center;
    height: 100px;
    background-color: white;
    button{
        position: relative;
        top: 30px;
    }
}
</style>


